/
RelationshipType.cs
78 lines (67 loc) · 2.36 KB
/
RelationshipType.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Entities.Users
{
using System;
using System.Data;
using System.Xml.Serialization;
using DotNetNuke.Entities.Modules;
using Newtonsoft.Json;
/// Project: DotNetNuke
/// Namespace: DotNetNuke.Entities.Users
/// Class: RelationshipType
/// <summary>The RelationshipType defines the core relationship types (Friend (2-way), Follower (1-way)).</summary>
[Serializable]
public class RelationshipType : BaseEntityInfo, IHydratable
{
private int relationshipTypeId = -1;
/// <summary>Gets or sets relationshipId - The primary key.</summary>
[XmlAttribute]
public int RelationshipTypeId
{
get
{
return this.relationshipTypeId;
}
set
{
this.relationshipTypeId = value;
}
}
/// <summary>Gets or sets relationship Type Name.</summary>
[XmlAttribute]
public string Name { get; set; }
/// <summary>Gets or sets relationship Description.</summary>
[XmlAttribute]
public string Description { get; set; }
/// <summary>Gets or sets relationship Direction.</summary>
[XmlAttribute]
public RelationshipDirection Direction { get; set; }
/// <summary>Gets or sets iHydratable.KeyID.</summary>
[XmlIgnore]
[JsonIgnore]
public int KeyID
{
get
{
return this.RelationshipTypeId;
}
set
{
this.RelationshipTypeId = value;
}
}
/// <summary>Fill the object with data from database.</summary>
/// <param name="dr">the data reader.</param>
public void Fill(IDataReader dr)
{
this.RelationshipTypeId = Convert.ToInt32(dr["RelationshipTypeID"]);
this.Name = dr["Name"].ToString();
this.Description = dr["Description"].ToString();
this.Direction = (RelationshipDirection)Convert.ToInt32(dr["Direction"]);
// add audit column data
this.FillInternal(dr);
}
}
}